package com.example.rocketmq.demo;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQReplyListener;
import org.springframework.stereotype.Component;

/**
 * 消费
 */
@Component
@RocketMQMessageListener(topic = "${rocketmq.producer.customized-trace-topic}",consumerGroup = "c-g",
        consumeMode = ConsumeMode.ORDERLY,selectorExpression = "*")
@Slf4j
public class Consumer2 implements RocketMQReplyListener {

    @Override
    public Object onMessage(Object message) {
        System.out.println("消费者2 " + message);
        return ConsumeOrderlyStatus.SUCCESS;
    }
}

